Update storage driver store context metadata#1399
Open
jmaeagle99 wants to merge 16 commits intotemporalio:mainfrom
Open
Update storage driver store context metadata#1399jmaeagle99 wants to merge 16 commits intotemporalio:mainfrom
jmaeagle99 wants to merge 16 commits intotemporalio:mainfrom
Conversation
fcb36db to
5a19712
Compare
tconley1428
reviewed
Apr 1, 2026
tconley1428
approved these changes
Apr 1, 2026
jmaeagle99
commented
Apr 1, 2026
Contributor
drewhoskins-temporal
left a comment
There was a problem hiding this comment.
re: your comments on CaN -- sequence # is an interesting idea.
| """The serialization context active when this store operation was initiated, | ||
| or ``None`` if no context has been set. | ||
| """ | ||
| target: StorageDriverActivityInfo | StorageDriverWorkflowInfo | None = None |
Contributor
There was a problem hiding this comment.
"target" struck me as odd since it's an info rather than a target. then my second thought was that target would be "where it's stored" rather than "what's being called."
Maybe callee_info or something?
| For payloads being stored on behalf of an explicit target (e.g. a child | ||
| workflow being started, an activity being scheduled, an external workflow | ||
| being signaled), this is that target's identity. When no explicit target | ||
| exists the current execution context (workflow or activity) is used as the |
Contributor
There was a problem hiding this comment.
separate caller_info field ? Feels like glossing over this distinction between source and target or caller and callee could result in bugs. Would rather callsites explicitly say what they want to refer to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
StorageDriverStoreContext.serialization_contextin favor of a new asymmetric context information system for storage drivers.The S3 driver will now generate all keys (assuming context is provided) such that the key will be in the following formats:
v0/ns/{namespace}/wt/{workflow_type}/wi/{workflow_id}/ri/{run_id}/d/sha256/{hash}for all workflow operations, andv0/ns/{namespace}/at/{activity_type}/ai/{activity_id}/ri/{run_id}/d/sha256/{hash}for standalone activity operations.The
nullsentinel value is used for any token which is not known at during the driver store operation. For example, when starting a workflow from a client, the run ID of the worklfow is not known and will have anullvalue for the{run_id}token.Key Segments by Operation
The overall idea is that payloads are stored into the key space of the target of the operation. The exception is when there is no target (standalone activities results, parentless workflow results), the target is set to the current workflow/activity.
start_workflowwt=type,wi=ID,ri=nullsignal_workflowwt=null,wi=ID,ri=run ID ornullsignal_with_startwt=type,wi=ID,ri=nullexecute_updatewt=null,wi=ID,ri=run ID ornullquery_workflowwt=null,wi=ID,ri=run ID ornullwt=type,wi=ID,ri=nullwt=null,wi=workflow ID,ri=run ID ornullat=null,ai=activity ID,ri=nullwt=type,wi=ID,ri=run IDwt=type,wi=ID,ri=nullwt=null,wi=ID,ri=nullwt=type,wi=ID,ri=run IDwt=type,wi=ID,ri=run IDNo parent workflow: Keyed under current workflow
wt=type,wi=ID,ri=run IDwt=type,wi=ID,ri=run IDStandalone activity: Keyed under current activity
One scenario that needs to be fixed is CaN, but that requires more work in assigning a sequence number an serialization context seems to not support it correctly. Would advocate for fixing separate from this PR.
Why?
SerializationContextChecklist